import { lazy } from "react";
export const mainRouter=[
    {
        path:'/index/home',
        component:lazy(()=>import('../page/index/Home')),
        title:'首页'
    },
    {
        path:'/index/class',
        component:lazy(()=>import('../page/index/Class')),
        title:'分类'
    },
    {
        path:'/index/car',
        component:lazy(()=>import('../page/index/Car')),
        title:'购物车'
    },
    {
        path:'/index/my',
        component:lazy(()=>import('../page/index/My')),
        title:'我的'
    },
]
const routes=[
    {
        path:'/',
        to:'/index/home'
    },  
    {
        path:'/index',
        component:lazy(()=>import('../page/Index')),
        children:mainRouter
    },
    {
        path:'/detail/:id',
        component:lazy(()=>import('../page/Detail'))
    },
    {
        path:'*',
        component:lazy(()=>import('../page/Erroy'))
    },

]
export default routes